﻿using System;


namespace Class_Object
{
    class Account
    {
        private string accountName;
        private string accountID;
        private double balance;

        public double GetBalance()
        {
            return balance;
        }

        public string GetID()
        {
            return this.accountID;
        }

        private double GetAmount()
        {
            Label1:
            double amount;
            amount = Convert.ToDouble(Console.ReadLine());
            if (amount < 0)
            {
                Console.WriteLine("Nice Trick, Now Enter Positive Amount :D :P");
                goto Label1;
            }
            return amount;
        }

        public void Set_values()
        {
            Console.WriteLine("New Account : ");
            Console.Write("Enter name : ");
            this.accountName = Console.ReadLine();
            Console.Write("Enter id : ");
            this.accountID = Console.ReadLine();
        }

        public string Deposit()
        {
            Console.WriteLine("\nEnter Deposit Amount : ");
            double amt = this.GetAmount();
            this.balance = this.balance + amt;
            return "Deposit Done";
        }

        public string Withdraw()
        {
            Console.WriteLine("\nEnter Withdraw Amount : ");
            double amt = this.GetAmount();

            if (this.balance > amt)
            {
                this.balance = this.balance - amt;
                return "Deposit Done";
            }
            else
                return "Deposit Failed, Insufficient Balance";
        }

        public void ShowDetails()
        {
            Console.WriteLine("Output : ");
            Console.WriteLine("Name = " + this.accountName);
            Console.WriteLine("ID = " + this.accountID);
            Console.WriteLine("Balance = " + this.balance);
        }


    }
}
